package com.qf.lanzhou.shop.api.controller;


import com.qf.lanzhou.shop.pojo.entity.Category;
import com.qf.lanzhou.shop.pojo.vo.BaseRespVO;
import com.qf.lanzhou.shop.api.service.CategoryService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Author Nerly
 * @Date 2021/1/8 15:05
 * @JDK 1.8
 * @Version 1.0
 */
@RestController("/category")
@Api(tags = "分类导航栏接口")
public class CategoryController extends BaseController {
    @Autowired
    private CategoryService categoryService;

    @GetMapping("/getAll")
    @ApiOperation(value = "获取所有分类信息")
    public BaseRespVO selectAll() {
        List<Category> categoryList = categoryService.selectAll();
        return convertSuccessResult(categoryList);
    }
}
